package com.joker.userExam.dao.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.joker.userExam.dao.ISubjectOneQuestion;
import com.joker.userExam.dao.repo.SubjectOneQuestionRepo;
import com.joker.userExam.model.SubjectOneQuestion;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @author 李杰
 * @date 2021/5/2 - 10:10
 */

@Component
public class SubjectOneQuestionImpl implements ISubjectOneQuestion {

    @Autowired
    SubjectOneQuestionRepo subjectOneQuestionRepo;

    @Override
    public List<SubjectOneQuestion> queryAllByType(List type) {

        QueryWrapper<SubjectOneQuestion> queryWrapper = new QueryWrapper<>();
        queryWrapper.in("type", type);
        List<SubjectOneQuestion> list = subjectOneQuestionRepo.list(queryWrapper);

        return list;
    }
}
